#include "GUI/Graph.h"
#include "Graph_ext.h"

namespace Graph_lib{
    
    void Group::attach_shape(Shape* s){
       shapes.push_back(s);
    }

    void Group::attach_shape(Shape& s){
       shapes.push_back(s);
    }

    void Group::draw_lines() const {
        for (int i=0; i< shapes.size(); ++i)
            shapes[i].draw();
    }

    void Filled_Circle::draw_lines() const{
        if (fill_color().visibility()){
            fl_color(fill_color().as_int());
            fl_pie(point(0).x, point(0).y,
                    radius()+radius(), 
                    radius()+radius(),
                    0,360);
        }
        if (color().visibility()){
            fl_color(color().as_int());
            fl_arc(point(0).x,point(0).y,
                    radius()+radius(),
                    radius()+radius(),
                    0,360);
	}
}
}
